package com.packenius.library.xspdf;

import java.util.HashMap;
import java.util.Map;

/**
 * Alternative font encoding.
 * 
 * @author Christian Packenius, 2013.
 */
class XST1AltFontEncoding1 extends XSAlternativeFontEncoding {
  /**
   * Maps an Utf-8 (Unicode?) code (0..65535) to the byte in this font encoding.
   */
  static final Map<Character, Character> altFontEncoding1 = new HashMap<Character, Character>();

  private static final String altFontEnc1Diffs = "127 /Idieresis /eacute /abreve /uhungarumlaut /ecaron /Ydieresis /divide /Yacute /Acircumflex /aacute /Ucircumflex /yacute /scommaaccent /ecircumflex /Uring /Udieresis /aogonek /Uacute /uogonek /Edieresis /Dcroat /commaaccent /copyright /Emacron /ccaron /aring /Ncommaaccent /lacute /agrave /Tcommaaccent /Cacute /atilde /Edotaccent /scaron 176 /scedilla 181 /iacute 190 /lozenge 192 /Rcaron 201 /Gcommaaccent 204 /ucircumflex 209 /acircumflex /Amacron /rcaron /ccedilla /Zdotaccent /Thorn /Omacron /Racute /Sacute /dcaron /Umacron /uring /threesuperior /Ograve /Agrave /Abreve 226 /multiply 228 /uacute /Tcaron /partialdiff /ydieresis 236 /Nacute /icircumflex /Ecircumflex /adieresis /edieresis 242 /cacute /nacute /umacron 246 /Ncaron /Iacute";

  static {
    altFontEncoding1.put('\u00cf', (char) 127);
    altFontEncoding1.put('\u00e9', (char) 128);
    altFontEncoding1.put('\u0103', (char) 129);
    altFontEncoding1.put('\u0171', (char) 130);
    altFontEncoding1.put('\u011b', (char) 131);
    altFontEncoding1.put('\u0178', (char) 132);
    altFontEncoding1.put('\u00f7', (char) 133);
    altFontEncoding1.put('\u00dd', (char) 134);
    altFontEncoding1.put('\u00c2', (char) 135);
    altFontEncoding1.put('\u00e1', (char) 136);
    altFontEncoding1.put('\u00db', (char) 137);
    altFontEncoding1.put('\u00fd', (char) 138);
    altFontEncoding1.put('\u0219', (char) 139);
    altFontEncoding1.put('\u00ea', (char) 140);
    altFontEncoding1.put('\u016e', (char) 141);
    altFontEncoding1.put('\u00dc', (char) 142);
    altFontEncoding1.put('\u0105', (char) 143);
    altFontEncoding1.put('\u00da', (char) 144);
    altFontEncoding1.put('\u0173', (char) 145);
    altFontEncoding1.put('\u00cb', (char) 146);
    altFontEncoding1.put('\u0110', (char) 147);
    altFontEncoding1.put('\uf6c3', (char) 148);
    altFontEncoding1.put('\u00a9', (char) 149);
    altFontEncoding1.put('\u0112', (char) 150);
    altFontEncoding1.put('\u010d', (char) 151);
    altFontEncoding1.put('\u00e5', (char) 152);
    altFontEncoding1.put('\u0145', (char) 153);
    altFontEncoding1.put('\u013a', (char) 154);
    altFontEncoding1.put('\u00e0', (char) 155);
    altFontEncoding1.put('\u0162', (char) 156);
    altFontEncoding1.put('\u0106', (char) 157);
    altFontEncoding1.put('\u00e3', (char) 158);
    altFontEncoding1.put('\u0116', (char) 159);
    altFontEncoding1.put('\u0161', (char) 160);
    altFontEncoding1.put('\u015f', (char) 176);
    altFontEncoding1.put('\u00ed', (char) 181);
    altFontEncoding1.put('\u25ca', (char) 190);
    altFontEncoding1.put('\u0158', (char) 192);
    altFontEncoding1.put('\u0122', (char) 201);
    altFontEncoding1.put('\u00fb', (char) 204);
    altFontEncoding1.put('\u00e2', (char) 209);
    altFontEncoding1.put('\u0100', (char) 210);
    altFontEncoding1.put('\u0159', (char) 211);
    altFontEncoding1.put('\u00e7', (char) 212);
    altFontEncoding1.put('\u017b', (char) 213);
    altFontEncoding1.put('\u00de', (char) 214);
    altFontEncoding1.put('\u014c', (char) 215);
    altFontEncoding1.put('\u0154', (char) 216);
    altFontEncoding1.put('\u015a', (char) 217);
    altFontEncoding1.put('\u010f', (char) 218);
    altFontEncoding1.put('\u016a', (char) 219);
    altFontEncoding1.put('\u016f', (char) 220);
    altFontEncoding1.put('\u00b3', (char) 221);
    altFontEncoding1.put('\u00d2', (char) 222);
    altFontEncoding1.put('\u00c0', (char) 223);
    altFontEncoding1.put('\u0102', (char) 224);
    altFontEncoding1.put('\u00d7', (char) 226);
    altFontEncoding1.put('\u00fa', (char) 228);
    altFontEncoding1.put('\u0164', (char) 229);
    altFontEncoding1.put('\u2202', (char) 230);
    altFontEncoding1.put('\u00ff', (char) 231);
    altFontEncoding1.put('\u0143', (char) 236);
    altFontEncoding1.put('\u00ee', (char) 237);
    altFontEncoding1.put('\u00ca', (char) 238);
    altFontEncoding1.put('\u00e4', (char) 239);
    altFontEncoding1.put('\u00eb', (char) 240);
    altFontEncoding1.put('\u0107', (char) 242);
    altFontEncoding1.put('\u0144', (char) 243);
    altFontEncoding1.put('\u016b', (char) 244);
    altFontEncoding1.put('\u0147', (char) 246);
    altFontEncoding1.put('\u00cd', (char) 247);
  }

  /**
   * @see com.packenius.library.xspdf.XSAlternativeFontEncoding#getPdfDifferencesListContent()
   */
  @Override
  public String getPdfDifferencesListContent() {
    return altFontEnc1Diffs;
  }

  /**
   * @see com.packenius.library.xspdf.XSAlternativeFontEncoding#getID()
   */
  @Override
  public String getID() {
    return "1";
  }

  /**
   * @see com.packenius.library.xspdf.XSAlternativeFontEncoding#getCharacterEncodingMap()
   */
  @Override
  public Map<Character, Character> getCharacterEncodingMap() {
    return altFontEncoding1;
  }
}
